
    $(function(){
        $("#groupsel").on('click', function(){

            var curstate = $(this).prop("checked");
            $("input[type=checkbox]").each(function(){

                $(this).prop("checked", curstate);
            })
        })


    })

    function SelectAll() {
        var checkboxs=document.getElementsByName("file");
        for (var i=0;i<checkboxs.length;i++) {
            var e=checkboxs[i];
            e.checked=!e.checked;
        }
    }

    $(document).ready(function(){
        /* 定义所有class为copy标签，点击后可复制被点击对象的文本 */
        $("#copy").zclip({
            path: "/js/ZeroClipboard.swf",
            copy: function(){
                obj = document.getElementsByName("file");
                var clipBoardContent="";
                for(k in obj){
                    if(obj[k].checked)
                        clipBoardContent+=obj[k].value+'\r\n';
                }
                return clipBoardContent;
            },
            beforeCopy:function(){/* 按住鼠标时的操作 */
                $(this).css("color","orange");
            },
            afterCopy:function(){/* 复制成功后的操作 */
                var $copysuc = $("<div class='copy-tips'><div class='copy-tips-wrap'>☺ 复制成功</div></div>");
                $("body").find(".copy-tips").remove().end().append($copysuc);
                $(".copy-tips").fadeOut(3000);
            }
        });

        $("#copyadd").zclip({
            path: "/js/ZeroClipboar1d.swf",
            copy: function(){
                obj = document.getElementsByName("file");
                var clipBoardContent="";
                for(k in obj){
                    if(obj[k].checked)
                        clipBoardContent+=obj[k].id+'\r\n';
                }
                return clipBoardContent;
            },
            beforeCopy:function(){/* 按住鼠标时的操作 */
                $(this).css("color","orange");
            },
            afterCopy:function(){/* 复制成功后的操作 */
                var $copysuc = $("<div class='copy-tips'><div class='copy-tips-wrap'>☺ 复制成功</div></div>");
                $("body").find(".copy-tips").remove().end().append($copysuc);
                $(".copy-tips").fadeOut(3000);
            }
        });

        $("#copydown").zclip({
            path: "/js/ZeroClipboard.swf",
            copy: function(){
                obj = document.getElementsByName("file");
                var clipBoardContent="";
                for(k in obj){
                    if(obj[k].checked)
                        clipBoardContent+=obj[k].title+'\r\n';
                }
                return clipBoardContent;
            },
            beforeCopy:function(){/* 按住鼠标时的操作 */
                $(this).css("color","orange");
            },
            afterCopy:function(){/* 复制成功后的操作 */
                var $copysuc = $("<div class='copy-tips'><div class='copy-tips-wrap'>☺ 复制成功</div></div>");
                $("body").find(".copy-tips").remove().end().append($copysuc);
                $(".copy-tips").fadeOut(3000);
            }
        });
    });

